<?php

try{

	$db = @new PDO("mysql:host=127.0.0.1;dbname=school;charset=utf8","root","root");

	// $sql = "insert into stu (sname,age,sex) values('小明明8888',20,'男')";

	// $sql = "update stu set age=30 where sex='女11'";

	// $res = $db->exec($sql);

	// var_dump($res);

	// $sql = "update stu set age=30";

	$sql = "select * from stu ";

	$res = $db->query($sql);

	var_dump($res->fetchAll(PDO::FETCH_ASSOC));

}catch (PDOException $e) {
	// var_dump($e);
}


